﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ECCSystem.BizRule
{ 
    class ClsReports
    {
        DataAccess.ClsReports objReports = new ECCSystem.DataAccess.ClsReports();
        public ClsReports()
        { }

		#region "Old"
		//CSR Report
        public object GetCSRReport(string strStartDate, string strEndDate)
        {
            return objReports.GetCSRReport(strStartDate, strEndDate);
        }

        //Extras Report
        public object GetExtrasReport(string strStartDate, string strEndDate)
        {
            return objReports.GetExtrasReport(strStartDate, strEndDate);
        }

        //Japans Report
        public object GetJapansReport(string strStartDate, string strEndDate,string strOperator)
        {
            return objReports.GetJapansReport(strStartDate, strEndDate, strOperator);
        }

        //CSR Mail Category Report
        public object GetCRSCategoryReport(string strDate, int intOperatorID)
        {
            return objReports.GetCRSCategoryReport(strDate, intOperatorID);
        }

        //Team Mail Category Report
        public object GetTeamCategoryReport(string strStartDate, string strEndDate)
        {
            return objReports.GetTeamCategoryReport(strStartDate, strEndDate);
        }

        //CSR Productivity Report
        public object GetCSRProductivityReport(string strStartDate, string strEndDate)
        {
            return objReports.GetCSRProductivityReport(strStartDate, strEndDate);
        }

        //Team Productivity Report
        public object GetTeamProductivityReport(string strStartDate, string strEndDate)
        {
            return objReports.GetTeamProductivityReport(strStartDate, strEndDate);
        }

        //Sale Commodity Report
        public object GetSaleCommodityReport(string strDate)
        {
            return objReports.GetSaleCommodityReport(strDate);
		}
		#endregion

        public object GetSettingOFFCategory()
        {
            return objReports.GetSettingOFFCategory();
        }

        public object GetSettingCategory()
        {
            return objReports.GetSettingCategory();
        }

        

        public object GetMaiReceivedReport(DateTime dtStartDate, DateTime dtEndDate)
        {
            return objReports.GetMaiReceivedReport(
                SetStartDate(dtStartDate, "00:00:00"),
                SetEndDate(dtEndDate, "00:00:00")
                );
        }

        public object GetOFFAnnotationReport(DateTime dtStartDate, DateTime dtEndDate)
        {
            return objReports.GetOFFAnnotationReport(
                SetStartDate(dtStartDate, "00:00:00"),
                SetEndDate(dtEndDate, "00:00:00")
                );
        }

		public object GetPersonalMailReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetPersonalMailReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetMailCheckReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetMailCheckReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetEfficiencyReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetEfficiencyReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetDetailMemberReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetDetailMemberReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object DetailManagementReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.DetailManagementReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object CategoryReportReport(DateTime dtStartDate, DateTime dtEndDate, string strKeyID)
		{
			return objReports.CategoryReportReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate), strKeyID);
		}

		public object GetEfficiencyOverTimeReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetEfficiencyOverTimeReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetPersonalAppointMailReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetPersonalAppointMailReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetAppointEfficiencyReport(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetAppointEfficiencyReport(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetCSRProductivityReportNew(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetCSRProductivityReportNew(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}
		public object GetWorkModeReport()
		{
			return objReports.GetWorkModeReport();
		}

		public object GetTeamProductivityNew(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetTeamProductivityNew(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		public object GetTeamCategoryNew(DateTime dtStartDate, DateTime dtEndDate)
		{
			return objReports.GetTeamCategoryNew(SetStartDate(dtStartDate), SetEndDate(dtEndDate));
		}

		private DateTime SetStartDate(DateTime dtDateTime)
		{
			string strTime;
			string strDate;
			strTime = ClsCommon.gStrStart;
			strDate = dtDateTime.ToLongDateString();

			return Convert.ToDateTime(strDate + " " + strTime);
		}

		private DateTime SetEndDate(DateTime dtDateTime)
		{
			string strTime;
			string strDate;
			strTime = ClsCommon.gStrEnd;
			strDate = dtDateTime.AddDays(1).ToLongDateString();

			return Convert.ToDateTime(strDate + " " + strTime);
		}
        
        private DateTime SetStartDate(DateTime dtDateTime, string strTime)
        {
            //string strTime;
            string strDate;
            //strTime = ClsCommon.gStrStart;
            strDate = dtDateTime.ToLongDateString();

            return Convert.ToDateTime(strDate + " " + strTime);
        }

        private DateTime SetEndDate(DateTime dtDateTime, string strTime)
        {
            //string strTime;
            string strDate;
            //strTime = ClsCommon.gStrEnd;
            strDate = dtDateTime.AddDays(1).ToLongDateString();

            return Convert.ToDateTime(strDate + " " + strTime);
        }


	}
}
